package com.neusoft.neuiotms.dcom.model.report;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Entity
@org.hibernate.annotations.Table(appliesTo = "neuiot_report_tool_item", comment = "报表工具详情表")
@Table(name = "neuiot_report_tool_item")
public class ReportToolItem extends AbstractAuditModel {

    private static final long serialVersionUID = 8592757433517690504L;

    /** sql赋值编码 */
    @NotBlank(message = "sql赋值编码不能为空")
    @Length(max = 255, message = "sql赋值编码不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT 'sql赋值编码'")
    private String sqlCode;

    /** sql赋值类型 */
    @NotBlank(message = "sql赋值类型不能为空")
    @Length(max = 255, message = "sql赋值类型不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT 'sql赋值类型'")
    private String sqlCodeType;

    /** sql查询条件 */
    @NotBlank(message = "sql查询条件不能为空")
    @Length(max = 255, message = "sql查询条件不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT 'sql查询条件'")
    private String sqlCondition;

    @ManyToOne
    private ReportTool reportTool;

}
